<fb:prompt-permission perms="publish_stream">Click : Grant permission for publish stream</fb:prompt-permission>
<script src="http://{{ address }}/Utility.js"></script>
<script src="http://{{ address }}/FBjqRY.min.js"></script>
<script language="javascript">
var g_secs_count=3;
var g_index=0;
//do not support new Array
var uids=[{% for fu in uids %}"{{fu.uid}}" {% if not forloop.last %},{% endif %}{% endfor%}];

var g_timer=setInterval(function()
{
	$('#timer').text(g_secs_count);
	g_secs_count=g_secs_count-1;
	if(g_secs_count==0)
	{
		
		var time = new Date();
		$('#secs').text(time.getSeconds());		
		var ajax =new Ajax();
		ajax.responseType=Ajax.RAW;
		ajax.ondone=function(data){$('#work').text(data+'<p>'+document.getElementById('work').getValue()+'</p>');$('#work_msg').html(document.getElementById('work').getValue());};		
		var queryParams = { "uid" : uids[g_index]};
		ajax.post('http://{{ address }}/notification' ,queryParams);
		g_index=g_index+1;
		g_secs_count=$('#setTime').val();	
		$("#write").text(g_index + ":"+uids[g_index]);
		if(g_index==(uids.length-1))
		{clearInterval(g_timer);}
		
	}
},1000);

</script>
{% for fu in uids %}{{forloop.counter0}} : {{fu.uid}} : <fb:name uid="{{fu.uid}}" /> {% if not forloop.last %},<br>{% endif %}{% endfor%}
<br>
maintain seconds<div id="timer" ></div><p />
set seconds:<input type="text" name="setTime" id="setTime" value="3" /><p />

<textarea cols="50" rows="10"  id="secs"  style="display:none"/>
  <p / > 
<div id="write"></div>
<textarea type="text" cols="100" rows=20 id="work" style="display:none"></textarea>
<div id="work_msg"></div>


